package com.sdjzu.wangfuying.hellospringboot.aspect;


import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

@Aspect
@Component
public class ApiPerformanceAspect {
    private final Logger logger = LoggerFactory.getLogger(ApiPerformanceAspect.class);
    private static final String POINT_CUT = "execution(public * com.sdjzu.wangfuying.hellospringboot.controller.ApiController.*(..))";

    /*@PointCut注解表示表示横切点，哪些方法需要被横切*/
    /*切点表达式*/
    @Pointcut(POINT_CUT)
    /*切点签名*/
    public void record() {
    }

    @Before(POINT_CUT)
    public void before(JoinPoint joinPoint) {
    }

    @After(POINT_CUT)
    public void after() {
    }

    @AfterReturning(pointcut = POINT_CUT, returning = "ret")
    public void afterReturning(Object ret) {
    }
}
